package com.zengyan.gd.model;


import org.hibernate.validator.constraints.NotEmpty;
import org.hibernate.validator.constraints.URL;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.validation.constraints.NotNull;

import lombok.Data;


/**
 * CREATE TABLE `event` (
 `event_id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '活动id',
 `organization_id` int(11) NOT NULL COMMENT '组织id',
 `title` varchar(64) DEFAULT NULL COMMENT '标题',
 `bg` varchar(512) DEFAULT NULL COMMENT '背景图' ,
 `description` varchar(512) DEFAULT NULL COMMENT '描述',
 `detail_url` varchar(512) DEFAULT NULL COMMENT '推文链接',
 `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
 `update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '创建时间',
 PRIMARY KEY (`event_id`),
 UNIQUE KEY `uqe_event_id` (`event_id`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;

 */
@Entity
@Data
public class Event {


    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "event_id")
    private int id;

    @Column(name = "organization_id")
    @NotNull(message = "所属组织id 必填")
    private int orgId;

    @NotEmpty(message = "活动标题 必填")
    private String title;

    @Column(name = "bg")
//    @NotEmpty(message = "背景图url 必填")
    private String bgUrl; //班级

    @NotEmpty(message = "描述 必填")
    private String description; //描述

    @Column(name = "detail_url")
    @NotEmpty(message = "推文链接 必填")
    @URL
    private String detailUrl; //推文链接





}
